<?php


abstract class BaseKernelUsuario extends BaseObject  implements Persistent {


	
	protected static $peer;

	
	protected $usuario;

	
	protected $tercero_id;

	
	protected $sha1_clave;

	
	protected $aleatorio;

	
	protected $id;

	
	protected $aKernelTercero;

	
	protected $collContratacionContratos;

	
	private $lastContratacionContratoCriteria = null;

	
	protected $collKernelMenuUsuarios;

	
	private $lastKernelMenuUsuarioCriteria = null;

	
	protected $alreadyInSave = false;

	
	protected $alreadyInValidation = false;

	
	public function __construct()
	{
		$this->applyDefaultValues();
	}

	
	public function applyDefaultValues()
	{
	}

	
	public function getUsuario()
	{
		return $this->usuario;
	}

	
	public function getTerceroId()
	{
		return $this->tercero_id;
	}

	
	public function getSha1Clave()
	{
		return $this->sha1_clave;
	}

	
	public function getAleatorio()
	{
		return $this->aleatorio;
	}

	
	public function getId()
	{
		return $this->id;
	}

	
	public function setUsuario($v)
	{
		if ($v !== null) {
			$v = (string) $v;
		}

		if ($this->usuario !== $v) {
			$this->usuario = $v;
			$this->modifiedColumns[] = KernelUsuarioPeer::USUARIO;
		}

		return $this;
	} 
	
	public function setTerceroId($v)
	{
		if ($v !== null) {
			$v = (int) $v;
		}

		if ($this->tercero_id !== $v) {
			$this->tercero_id = $v;
			$this->modifiedColumns[] = KernelUsuarioPeer::TERCERO_ID;
		}

		if ($this->aKernelTercero !== null && $this->aKernelTercero->getId() !== $v) {
			$this->aKernelTercero = null;
		}

		return $this;
	} 
	
	public function setSha1Clave($v)
	{
		if ($v !== null) {
			$v = (string) $v;
		}

		if ($this->sha1_clave !== $v) {
			$this->sha1_clave = $v;
			$this->modifiedColumns[] = KernelUsuarioPeer::SHA1_CLAVE;
		}

		return $this;
	} 
	
	public function setAleatorio($v)
	{
		if ($v !== null) {
			$v = (string) $v;
		}

		if ($this->aleatorio !== $v) {
			$this->aleatorio = $v;
			$this->modifiedColumns[] = KernelUsuarioPeer::ALEATORIO;
		}

		return $this;
	} 
	
	public function setId($v)
	{
		if ($v !== null) {
			$v = (string) $v;
		}

		if ($this->id !== $v) {
			$this->id = $v;
			$this->modifiedColumns[] = KernelUsuarioPeer::ID;
		}

		return $this;
	} 
	
	public function hasOnlyDefaultValues()
	{
						if (array_diff($this->modifiedColumns, array())) {
				return false;
			}

				return true;
	} 
	
	public function hydrate($row, $startcol = 0, $rehydrate = false)
	{
		try {

			$this->usuario = ($row[$startcol + 0] !== null) ? (string) $row[$startcol + 0] : null;
			$this->tercero_id = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null;
			$this->sha1_clave = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null;
			$this->aleatorio = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null;
			$this->id = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null;
			$this->resetModified();

			$this->setNew(false);

			if ($rehydrate) {
				$this->ensureConsistency();
			}

						return $startcol + 5; 
		} catch (Exception $e) {
			throw new PropelException("Error populating KernelUsuario object", $e);
		}
	}

	
	public function ensureConsistency()
	{

		if ($this->aKernelTercero !== null && $this->tercero_id !== $this->aKernelTercero->getId()) {
			$this->aKernelTercero = null;
		}
	
	} 
	
	public function reload($deep = false, PropelPDO $con = null)
	{
		if ($this->isDeleted()) {
			throw new PropelException("Cannot reload a deleted object.");
		}

		if ($this->isNew()) {
			throw new PropelException("Cannot reload an unsaved object.");
		}

		if ($con === null) {
			$con = Propel::getConnection(KernelUsuarioPeer::DATABASE_NAME, Propel::CONNECTION_READ);
		}

				
		$stmt = KernelUsuarioPeer::doSelectStmt($this->buildPkeyCriteria(), $con);
		$row = $stmt->fetch(PDO::FETCH_NUM);
		$stmt->closeCursor();
		if (!$row) {
			throw new PropelException('Cannot find matching row in the database to reload object values.');
		}
		$this->hydrate($row, 0, true); 
		if ($deep) {  
			$this->aKernelTercero = null;
			$this->collContratacionContratos = null;
			$this->lastContratacionContratoCriteria = null;

			$this->collKernelMenuUsuarios = null;
			$this->lastKernelMenuUsuarioCriteria = null;

		} 	}

	
	public function delete(PropelPDO $con = null)
	{
		if ($this->isDeleted()) {
			throw new PropelException("This object has already been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(KernelUsuarioPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
		}

		try {
			$con->beginTransaction();
			KernelUsuarioPeer::doDelete($this, $con);
			$this->setDeleted(true);
			$con->commit();
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	public function save(PropelPDO $con = null)
	{
		if ($this->isDeleted()) {
			throw new PropelException("You cannot save an object that has been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(KernelUsuarioPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
		}

		try {
		    if($this->validate())
		    {
    			$con->beginTransaction();
    			$affectedRows = $this->doSave($con);
    			$con->commit();
    			KernelUsuarioPeer::addInstanceToPool($this);
    			return true;
			}else
			{
			     
                 return false;
            }
		} catch (PropelException $e) {
			$con->rollback();
			
			
			ErrorLog::reportarError('errors', 'error',  $e->getMessage() );
			return false;
		}
	}

	
	protected function doSave(PropelPDO $con)
	{
		$affectedRows = 0; 		if (!$this->alreadyInSave) {
			$this->alreadyInSave = true;

												
			if ($this->aKernelTercero !== null) {
				if ($this->aKernelTercero->isModified() || $this->aKernelTercero->isNew()) {
					$affectedRows += $this->aKernelTercero->save($con);
				}
				$this->setKernelTercero($this->aKernelTercero);
			}


						if ($this->isModified()) {
				if ($this->isNew()) {
					$pk = KernelUsuarioPeer::doInsert($this, $con);
					$affectedRows += 1; 										 										 
					$this->setId($pk);  
					$this->setNew(false);
				} else {
					$affectedRows += KernelUsuarioPeer::doUpdate($this, $con);
				}

				$this->resetModified(); 			}

			if ($this->collContratacionContratos !== null) {
				foreach ($this->collContratacionContratos as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collKernelMenuUsuarios !== null) {
				foreach ($this->collKernelMenuUsuarios as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			$this->alreadyInSave = false;

		}
		return $affectedRows;
	} 
	
	protected $validationFailures = array();

	
	public function getValidationFailures()
	{
		return $this->validationFailures;
	}

	
	public function validate($columns = null)
	{
		$res = $this->doValidate($columns);
		if ($res === true) {
			$this->validationFailures = array();
			return true;
		} else {
			$this->validationFailures = $res;
			return false;
		}
	}

	
	protected function doValidate($columns = null)
	{
		if (!$this->alreadyInValidation) {
			$this->alreadyInValidation = true;
			$retval = null;

			$failureMap = array();


												
			if ($this->aKernelTercero !== null) {
				if (!$this->aKernelTercero->validate($columns)) {
					$failureMap = array_merge($failureMap, $this->aKernelTercero->getValidationFailures());
				}
			}


			if (($retval = KernelUsuarioPeer::doValidate($this, $columns)) !== true) {
				$failureMap = array_merge($failureMap, $retval);
			}


				if ($this->collContratacionContratos !== null) {
					foreach ($this->collContratacionContratos as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collKernelMenuUsuarios !== null) {
					foreach ($this->collKernelMenuUsuarios as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}


			$this->alreadyInValidation = false;
		}

		return (!empty($failureMap) ? $failureMap : true);
	}

	
	public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = KernelUsuarioPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->getByPosition($pos);
	}

	
	public function getByPosition($pos)
	{
		switch($pos) {
			case 0:
				return $this->getUsuario();
				break;
			case 1:
				return $this->getTerceroId();
				break;
			case 2:
				return $this->getSha1Clave();
				break;
			case 3:
				return $this->getAleatorio();
				break;
			case 4:
				return $this->getId();
				break;
			default:
				return null;
				break;
		} 	}

	
	public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true)
	{
		$keys = KernelUsuarioPeer::getFieldNames($keyType);
		$result = array(
			$keys[0] => $this->getUsuario(),
			$keys[1] => $this->getTerceroId(),
			$keys[2] => $this->getSha1Clave(),
			$keys[3] => $this->getAleatorio(),
			$keys[4] => $this->getId(),
		);
		return $result;
	}

	
	public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = KernelUsuarioPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->setByPosition($pos, $value);
	}

	
	public function setByPosition($pos, $value)
	{
		switch($pos) {
			case 0:
				$this->setUsuario($value);
				break;
			case 1:
				$this->setTerceroId($value);
				break;
			case 2:
				$this->setSha1Clave($value);
				break;
			case 3:
				$this->setAleatorio($value);
				break;
			case 4:
				$this->setId($value);
				break;
		} 	}

	
	public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = KernelUsuarioPeer::getFieldNames($keyType);

		if (array_key_exists($keys[0], $arr)) $this->setUsuario($arr[$keys[0]]);
		if (array_key_exists($keys[1], $arr)) $this->setTerceroId($arr[$keys[1]]);
		if (array_key_exists($keys[2], $arr)) $this->setSha1Clave($arr[$keys[2]]);
		if (array_key_exists($keys[3], $arr)) $this->setAleatorio($arr[$keys[3]]);
		if (array_key_exists($keys[4], $arr)) $this->setId($arr[$keys[4]]);
	}

	
	public function buildCriteria()
	{
		$criteria = new Criteria(KernelUsuarioPeer::DATABASE_NAME);

		if ($this->isColumnModified(KernelUsuarioPeer::USUARIO)) $criteria->add(KernelUsuarioPeer::USUARIO, $this->usuario);
		if ($this->isColumnModified(KernelUsuarioPeer::TERCERO_ID)) $criteria->add(KernelUsuarioPeer::TERCERO_ID, $this->tercero_id);
		if ($this->isColumnModified(KernelUsuarioPeer::SHA1_CLAVE)) $criteria->add(KernelUsuarioPeer::SHA1_CLAVE, $this->sha1_clave);
		if ($this->isColumnModified(KernelUsuarioPeer::ALEATORIO)) $criteria->add(KernelUsuarioPeer::ALEATORIO, $this->aleatorio);
		if ($this->isColumnModified(KernelUsuarioPeer::ID)) $criteria->add(KernelUsuarioPeer::ID, $this->id);

		return $criteria;
	}

	
	public function buildPkeyCriteria()
	{
		$criteria = new Criteria(KernelUsuarioPeer::DATABASE_NAME);

		$criteria->add(KernelUsuarioPeer::ID, $this->id);

		return $criteria;
	}

	
	public function getPrimaryKey()
	{
		return $this->getId();
	}

	
	public function setPrimaryKey($key)
	{
		$this->setId($key);
	}

	
	public function copyInto($copyObj, $deepCopy = false)
	{

		$copyObj->setUsuario($this->usuario);

		$copyObj->setTerceroId($this->tercero_id);

		$copyObj->setSha1Clave($this->sha1_clave);

		$copyObj->setAleatorio($this->aleatorio);


		if ($deepCopy) {
									$copyObj->setNew(false);

			foreach ($this->getContratacionContratos() as $relObj) {
				if ($relObj !== $this) {  					$copyObj->addContratacionContrato($relObj->copy($deepCopy));
				}
			}

			foreach ($this->getKernelMenuUsuarios() as $relObj) {
				if ($relObj !== $this) {  					$copyObj->addKernelMenuUsuario($relObj->copy($deepCopy));
				}
			}

		} 

		$copyObj->setNew(true);

		$copyObj->setId(NULL); 
	}

	
	public function copy($deepCopy = false)
	{
				$clazz = get_class($this);
		$copyObj = new $clazz();
		$this->copyInto($copyObj, $deepCopy);
		return $copyObj;
	}

	
	public function getPeer()
	{
		if (self::$peer === null) {
			self::$peer = new KernelUsuarioPeer();
		}
		return self::$peer;
	}

	
	public function setKernelTercero(KernelTercero $v = null)
	{
		if ($v === null) {
			$this->setTerceroId(NULL);
		} else {
			$this->setTerceroId($v->getId());
		}

		$this->aKernelTercero = $v;

						if ($v !== null) {
			$v->addKernelUsuario($this);
		}

		return $this;
	}


	
	public function getKernelTercero(PropelPDO $con = null)
	{
		if ($this->aKernelTercero === null && ($this->tercero_id !== null)) {
			$this->aKernelTercero = KernelTerceroPeer::retrieveByPK($this->tercero_id, $con);
			
		}
		return $this->aKernelTercero;
	}

	
	public function clearContratacionContratos()
	{
		$this->collContratacionContratos = null; 	}

	
	public function getContratacionContratos($criteria = null, PropelPDO $con = null)
	{
		
		if ($criteria === null) {
			$criteria = new Criteria(KernelUsuarioPeer::DATABASE_NAME);
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collContratacionContratos === null) {
			if ($this->isNew()) {
			   $this->collContratacionContratos = array();
			} else {

				$criteria->add(ContratacionContratoPeer::USUARIO_ID, $this->getId());

				ContratacionContratoPeer::addSelectColumns($criteria);
				$this->collContratacionContratos = ContratacionContratoPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(ContratacionContratoPeer::USUARIO_ID, $this->getId());

				ContratacionContratoPeer::addSelectColumns($criteria);
				if (!isset($this->lastContratacionContratoCriteria) || !$this->lastContratacionContratoCriteria->equals($criteria)) {
					$this->collContratacionContratos = ContratacionContratoPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastContratacionContratoCriteria = $criteria;
		return $this->collContratacionContratos;
	}

	
	public function countContratacionContratos(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
	{
		
		if ($criteria === null) {
			$criteria = new Criteria(KernelUsuarioPeer::DATABASE_NAME);
		} else {
			$criteria = clone $criteria;
		}

		if ($distinct) {
			$criteria->setDistinct();
		}

		$count = null;

		if ($this->collContratacionContratos === null) {
			if ($this->isNew()) {
				$count = 0;
			} else {

				$criteria->add(ContratacionContratoPeer::USUARIO_ID, $this->getId());

				$count = ContratacionContratoPeer::doCount($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(ContratacionContratoPeer::USUARIO_ID, $this->getId());

				if (!isset($this->lastContratacionContratoCriteria) || !$this->lastContratacionContratoCriteria->equals($criteria)) {
					$count = ContratacionContratoPeer::doCount($criteria, $con);
				} else {
					$count = count($this->collContratacionContratos);
				}
			} else {
				$count = count($this->collContratacionContratos);
			}
		}
		$this->lastContratacionContratoCriteria = $criteria;
		return $count;
	}

	
	public function addContratacionContrato(ContratacionContrato $l)
	{
		if ($this->collContratacionContratos === null) {
			$this->collContratacionContratos = array();
		}
		if (!in_array($l, $this->collContratacionContratos, true)) { 			array_push($this->collContratacionContratos, $l);
			$l->setKernelUsuario($this);
		}
	}


	
	public function getContratacionContratosJoinContratacionModelo($criteria = null, $con = null)
	{
		
		if ($criteria === null) {
			$criteria = new Criteria(KernelUsuarioPeer::DATABASE_NAME);
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collContratacionContratos === null) {
			if ($this->isNew()) {
				$this->collContratacionContratos = array();
			} else {

				$criteria->add(ContratacionContratoPeer::USUARIO_ID, $this->getId());

				$this->collContratacionContratos = ContratacionContratoPeer::doSelectJoinContratacionModelo($criteria, $con);
			}
		} else {
									
			$criteria->add(ContratacionContratoPeer::USUARIO_ID, $this->getId());

			if (!isset($this->lastContratacionContratoCriteria) || !$this->lastContratacionContratoCriteria->equals($criteria)) {
				$this->collContratacionContratos = ContratacionContratoPeer::doSelectJoinContratacionModelo($criteria, $con);
			}
		}
		$this->lastContratacionContratoCriteria = $criteria;

		return $this->collContratacionContratos;
	}


	
	public function getContratacionContratosJoinKernelTercero($criteria = null, $con = null)
	{
		
		if ($criteria === null) {
			$criteria = new Criteria(KernelUsuarioPeer::DATABASE_NAME);
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collContratacionContratos === null) {
			if ($this->isNew()) {
				$this->collContratacionContratos = array();
			} else {

				$criteria->add(ContratacionContratoPeer::USUARIO_ID, $this->getId());

				$this->collContratacionContratos = ContratacionContratoPeer::doSelectJoinKernelTercero($criteria, $con);
			}
		} else {
									
			$criteria->add(ContratacionContratoPeer::USUARIO_ID, $this->getId());

			if (!isset($this->lastContratacionContratoCriteria) || !$this->lastContratacionContratoCriteria->equals($criteria)) {
				$this->collContratacionContratos = ContratacionContratoPeer::doSelectJoinKernelTercero($criteria, $con);
			}
		}
		$this->lastContratacionContratoCriteria = $criteria;

		return $this->collContratacionContratos;
	}

	
	public function clearKernelMenuUsuarios()
	{
		$this->collKernelMenuUsuarios = null; 	}

	
	public function getKernelMenuUsuarios($criteria = null, PropelPDO $con = null)
	{
		
		if ($criteria === null) {
			$criteria = new Criteria(KernelUsuarioPeer::DATABASE_NAME);
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collKernelMenuUsuarios === null) {
			if ($this->isNew()) {
			   $this->collKernelMenuUsuarios = array();
			} else {

				$criteria->add(KernelMenuUsuarioPeer::USUARIO_ID, $this->getId());

				KernelMenuUsuarioPeer::addSelectColumns($criteria);
				$this->collKernelMenuUsuarios = KernelMenuUsuarioPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(KernelMenuUsuarioPeer::USUARIO_ID, $this->getId());

				KernelMenuUsuarioPeer::addSelectColumns($criteria);
				if (!isset($this->lastKernelMenuUsuarioCriteria) || !$this->lastKernelMenuUsuarioCriteria->equals($criteria)) {
					$this->collKernelMenuUsuarios = KernelMenuUsuarioPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastKernelMenuUsuarioCriteria = $criteria;
		return $this->collKernelMenuUsuarios;
	}

	
	public function countKernelMenuUsuarios(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
	{
		
		if ($criteria === null) {
			$criteria = new Criteria(KernelUsuarioPeer::DATABASE_NAME);
		} else {
			$criteria = clone $criteria;
		}

		if ($distinct) {
			$criteria->setDistinct();
		}

		$count = null;

		if ($this->collKernelMenuUsuarios === null) {
			if ($this->isNew()) {
				$count = 0;
			} else {

				$criteria->add(KernelMenuUsuarioPeer::USUARIO_ID, $this->getId());

				$count = KernelMenuUsuarioPeer::doCount($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(KernelMenuUsuarioPeer::USUARIO_ID, $this->getId());

				if (!isset($this->lastKernelMenuUsuarioCriteria) || !$this->lastKernelMenuUsuarioCriteria->equals($criteria)) {
					$count = KernelMenuUsuarioPeer::doCount($criteria, $con);
				} else {
					$count = count($this->collKernelMenuUsuarios);
				}
			} else {
				$count = count($this->collKernelMenuUsuarios);
			}
		}
		$this->lastKernelMenuUsuarioCriteria = $criteria;
		return $count;
	}

	
	public function addKernelMenuUsuario(KernelMenuUsuario $l)
	{
		if ($this->collKernelMenuUsuarios === null) {
			$this->collKernelMenuUsuarios = array();
		}
		if (!in_array($l, $this->collKernelMenuUsuarios, true)) { 			array_push($this->collKernelMenuUsuarios, $l);
			$l->setKernelUsuario($this);
		}
	}


	
	public function getKernelMenuUsuariosJoinKernelMenu($criteria = null, $con = null)
	{
		
		if ($criteria === null) {
			$criteria = new Criteria(KernelUsuarioPeer::DATABASE_NAME);
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collKernelMenuUsuarios === null) {
			if ($this->isNew()) {
				$this->collKernelMenuUsuarios = array();
			} else {

				$criteria->add(KernelMenuUsuarioPeer::USUARIO_ID, $this->getId());

				$this->collKernelMenuUsuarios = KernelMenuUsuarioPeer::doSelectJoinKernelMenu($criteria, $con);
			}
		} else {
									
			$criteria->add(KernelMenuUsuarioPeer::USUARIO_ID, $this->getId());

			if (!isset($this->lastKernelMenuUsuarioCriteria) || !$this->lastKernelMenuUsuarioCriteria->equals($criteria)) {
				$this->collKernelMenuUsuarios = KernelMenuUsuarioPeer::doSelectJoinKernelMenu($criteria, $con);
			}
		}
		$this->lastKernelMenuUsuarioCriteria = $criteria;

		return $this->collKernelMenuUsuarios;
	}


	
	public function getKernelMenuUsuariosJoinKernelGrupo($criteria = null, $con = null)
	{
		
		if ($criteria === null) {
			$criteria = new Criteria(KernelUsuarioPeer::DATABASE_NAME);
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collKernelMenuUsuarios === null) {
			if ($this->isNew()) {
				$this->collKernelMenuUsuarios = array();
			} else {

				$criteria->add(KernelMenuUsuarioPeer::USUARIO_ID, $this->getId());

				$this->collKernelMenuUsuarios = KernelMenuUsuarioPeer::doSelectJoinKernelGrupo($criteria, $con);
			}
		} else {
									
			$criteria->add(KernelMenuUsuarioPeer::USUARIO_ID, $this->getId());

			if (!isset($this->lastKernelMenuUsuarioCriteria) || !$this->lastKernelMenuUsuarioCriteria->equals($criteria)) {
				$this->collKernelMenuUsuarios = KernelMenuUsuarioPeer::doSelectJoinKernelGrupo($criteria, $con);
			}
		}
		$this->lastKernelMenuUsuarioCriteria = $criteria;

		return $this->collKernelMenuUsuarios;
	}

	
	public function clearAllReferences($deep = false)
	{
		if ($deep) {
			foreach($this->collContratacionContratos as $o) {
				$o->clearAllReferences($deep);
			}
			foreach($this->collKernelMenuUsuarios as $o) {
				$o->clearAllReferences($deep);
			}
		} 
		$this->collContratacionContratos = null;
		$this->collKernelMenuUsuarios = null;
	}

} 